﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Processing;
using Processing.Structures;

namespace StrideSpike
{
    class NeKernel : AKernel
    {
        public NeKernel(Processor p) : base(p) { }

        protected override void SetArguments()
        {
            SetArgument(0, colors);
        }

        protected override string KernelProgramName
        {
            get { return "NeKernel"; }
        }

        protected override bool IsValidInitialized
        {
            get { return true; }
        }

        public Buffer<Byte4> colors;

        protected override long[] KernelProgramDimensions
        {
            get { return new long[] { colors.Length }; }
        }

        protected override string KernelProgramSource
        {
            get
            {
                return @"
                    kernel void NeKernel(
                        global write_only uchar4* colors
                    )
                    {
                        int i = get_global_id(0);
                        colors[i] = (uchar4)(255,  (uchar)i % 255, 0, 255);
                    }
                    "; 
            }
        }
    }
}
